import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class DaoFactory {
    private static Properties pro = new Properties();
    static {
        try {
            pro.load(new FileReader("dao.txt"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static Object getDao(String daoName){

        try {
           Class c = Class.forName(daoName);
           return c.getConstructor().newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

